{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Engine(mysql+pymysql://root:***@10.51.185.125:3306/lmq?charset=utf8)"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pymysql\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "from sqlalchemy import create_engine\n",
    "from copy import deepcopy\n",
    "engine = create_engine('mysql+pymysql://root:root123ABC@@10.51.185.125:3306/lmq?charset=utf8')\n",
    "engine"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "dataill_a = pd.read_sql('meal_order_detail1',con=engine)\n",
    "dataill_b = pd.read_sql('meal_order_detail2',con=engine)\n",
    "dataill_c = pd.read_sql('meal_order_detail3',con=engine)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "dataill = pd.concat([dataill_a,dataill_b,dataill_c],axis=0,sort=False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>detail_id</th>\n",
       "      <th>order_id</th>\n",
       "      <th>dishes_id</th>\n",
       "      <th>logicprn_name</th>\n",
       "      <th>parent_class_name</th>\n",
       "      <th>dishes_name</th>\n",
       "      <th>itemis_add</th>\n",
       "      <th>counts</th>\n",
       "      <th>amounts</th>\n",
       "      <th>cost</th>\n",
       "      <th>place_order_time</th>\n",
       "      <th>discount_amt</th>\n",
       "      <th>discount_reason</th>\n",
       "      <th>kick_back</th>\n",
       "      <th>add_inprice</th>\n",
       "      <th>add_info</th>\n",
       "      <th>bar_code</th>\n",
       "      <th>picture_file</th>\n",
       "      <th>emp_id</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>2956</td>\n",
       "      <td>417</td>\n",
       "      <td>610062</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>蒜蓉生蚝</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>49.0</td>\n",
       "      <td>NA</td>\n",
       "      <td>2016-08-01 11:05:00</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>0</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>caipu/104001.jpg</td>\n",
       "      <td>1442</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>2958</td>\n",
       "      <td>417</td>\n",
       "      <td>609957</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>蒙古烤羊腿</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>48.0</td>\n",
       "      <td>NA</td>\n",
       "      <td>2016-08-01 11:07:00</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>0</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>caipu/202003.jpg</td>\n",
       "      <td>1442</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>2961</td>\n",
       "      <td>417</td>\n",
       "      <td>609950</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>大蒜苋菜</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>NA</td>\n",
       "      <td>2016-08-01 11:07:00</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>0</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>caipu/303001.jpg</td>\n",
       "      <td>1442</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>2966</td>\n",
       "      <td>417</td>\n",
       "      <td>610038</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>芝麻烤紫菜</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NA</td>\n",
       "      <td>2016-08-01 11:11:00</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>0</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>caipu/105002.jpg</td>\n",
       "      <td>1442</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>2968</td>\n",
       "      <td>417</td>\n",
       "      <td>610003</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>蒜香包</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>NA</td>\n",
       "      <td>2016-08-01 11:11:00</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>0</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>caipu/503002.jpg</td>\n",
       "      <td>1442</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3606</td>\n",
       "      <td>5683</td>\n",
       "      <td>672</td>\n",
       "      <td>610049</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>爆炒双丝</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>35.0</td>\n",
       "      <td>NA</td>\n",
       "      <td>2016-08-31 21:53:00</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>0</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>caipu/301003.jpg</td>\n",
       "      <td>1089</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3607</td>\n",
       "      <td>5686</td>\n",
       "      <td>672</td>\n",
       "      <td>609959</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>小炒羊腰\\r\\n\\r\\n\\r\\n</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>36.0</td>\n",
       "      <td>NA</td>\n",
       "      <td>2016-08-31 21:54:00</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>0</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>caipu/202005.jpg</td>\n",
       "      <td>1089</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3608</td>\n",
       "      <td>5379</td>\n",
       "      <td>647</td>\n",
       "      <td>610012</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>香菇鹌鹑蛋</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>39.0</td>\n",
       "      <td>NA</td>\n",
       "      <td>2016-08-31 21:54:00</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>0</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>caipu/302001.jpg</td>\n",
       "      <td>1094</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3609</td>\n",
       "      <td>5380</td>\n",
       "      <td>647</td>\n",
       "      <td>610054</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>不加一滴油的酸奶蛋糕</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>NA</td>\n",
       "      <td>2016-08-31 21:55:00</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>0</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>caipu/501003.jpg</td>\n",
       "      <td>1094</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3610</td>\n",
       "      <td>5688</td>\n",
       "      <td>672</td>\n",
       "      <td>609953</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>凉拌菠菜</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>27.0</td>\n",
       "      <td>NA</td>\n",
       "      <td>2016-08-31 21:56:00</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>0</td>\n",
       "      <td>NA</td>\n",
       "      <td>NA</td>\n",
       "      <td>caipu/303004.jpg</td>\n",
       "      <td>1089</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10037 rows × 19 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     detail_id order_id dishes_id logicprn_name parent_class_name  \\\n",
       "0         2956      417    610062            NA                NA   \n",
       "1         2958      417    609957            NA                NA   \n",
       "2         2961      417    609950            NA                NA   \n",
       "3         2966      417    610038            NA                NA   \n",
       "4         2968      417    610003            NA                NA   \n",
       "...        ...      ...       ...           ...               ...   \n",
       "3606      5683      672    610049            NA                NA   \n",
       "3607      5686      672    609959            NA                NA   \n",
       "3608      5379      647    610012            NA                NA   \n",
       "3609      5380      647    610054            NA                NA   \n",
       "3610      5688      672    609953            NA                NA   \n",
       "\n",
       "           dishes_name itemis_add  counts  amounts cost    place_order_time  \\\n",
       "0                 蒜蓉生蚝          0     1.0     49.0   NA 2016-08-01 11:05:00   \n",
       "1                蒙古烤羊腿          0     1.0     48.0   NA 2016-08-01 11:07:00   \n",
       "2                 大蒜苋菜          0     1.0     30.0   NA 2016-08-01 11:07:00   \n",
       "3                芝麻烤紫菜          0     1.0     25.0   NA 2016-08-01 11:11:00   \n",
       "4                  蒜香包          0     1.0     13.0   NA 2016-08-01 11:11:00   \n",
       "...                ...        ...     ...      ...  ...                 ...   \n",
       "3606              爆炒双丝          0     1.0     35.0   NA 2016-08-31 21:53:00   \n",
       "3607  小炒羊腰\\r\\n\\r\\n\\r\\n          0     1.0     36.0   NA 2016-08-31 21:54:00   \n",
       "3608             香菇鹌鹑蛋          0     1.0     39.0   NA 2016-08-31 21:54:00   \n",
       "3609        不加一滴油的酸奶蛋糕          0     1.0      7.0   NA 2016-08-31 21:55:00   \n",
       "3610              凉拌菠菜          0     1.0     27.0   NA 2016-08-31 21:56:00   \n",
       "\n",
       "     discount_amt discount_reason kick_back add_inprice add_info bar_code  \\\n",
       "0              NA              NA        NA           0       NA       NA   \n",
       "1              NA              NA        NA           0       NA       NA   \n",
       "2              NA              NA        NA           0       NA       NA   \n",
       "3              NA              NA        NA           0       NA       NA   \n",
       "4              NA              NA        NA           0       NA       NA   \n",
       "...           ...             ...       ...         ...      ...      ...   \n",
       "3606           NA              NA        NA           0       NA       NA   \n",
       "3607           NA              NA        NA           0       NA       NA   \n",
       "3608           NA              NA        NA           0       NA       NA   \n",
       "3609           NA              NA        NA           0       NA       NA   \n",
       "3610           NA              NA        NA           0       NA       NA   \n",
       "\n",
       "          picture_file emp_id  \n",
       "0     caipu/104001.jpg   1442  \n",
       "1     caipu/202003.jpg   1442  \n",
       "2     caipu/303001.jpg   1442  \n",
       "3     caipu/105002.jpg   1442  \n",
       "4     caipu/503002.jpg   1442  \n",
       "...                ...    ...  \n",
       "3606  caipu/301003.jpg   1089  \n",
       "3607  caipu/202005.jpg   1089  \n",
       "3608  caipu/302001.jpg   1094  \n",
       "3609  caipu/501003.jpg   1094  \n",
       "3610  caipu/303004.jpg   1089  \n",
       "\n",
       "[10037 rows x 19 columns]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataill"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [],
   "source": [
    "users = pd.read_excel(r'C:\\Users\\Administrator\\Desktop\\users.xlsx')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [],
   "source": [
    "order = pd.read_csv(r'C:\\Users\\Administrator\\Desktop\\meal_order_info.csv',encoding='gbk')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0      1442\n",
       "1      1095\n",
       "2      1147\n",
       "3      1166\n",
       "4      1094\n",
       "       ... \n",
       "940    1095\n",
       "941    1089\n",
       "942    1155\n",
       "943    1094\n",
       "944    1113\n",
       "Name: emp_id, Length: 945, dtype: int64"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataill['emp_id']\n",
    "order['emp_id']\n",
    "users[]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = pd.merge(users,order,left_on='USER_ID',right_on='emp_id')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>USER_ID</th>\n",
       "      <th>MYID</th>\n",
       "      <th>ACCOUNT</th>\n",
       "      <th>NAME</th>\n",
       "      <th>ORGANIZE_ID</th>\n",
       "      <th>ORGANIZE_NAME</th>\n",
       "      <th>DUTY_ID</th>\n",
       "      <th>TITLE_ID</th>\n",
       "      <th>PASSWORD</th>\n",
       "      <th>EMAIL</th>\n",
       "      <th>...</th>\n",
       "      <th>lock_time</th>\n",
       "      <th>cashier_id</th>\n",
       "      <th>pc_id</th>\n",
       "      <th>order_number</th>\n",
       "      <th>org_id</th>\n",
       "      <th>print_doc_bill_num</th>\n",
       "      <th>lock_table_info</th>\n",
       "      <th>order_status</th>\n",
       "      <th>phone</th>\n",
       "      <th>name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>982</td>\n",
       "      <td>NaN</td>\n",
       "      <td>叶亦凯</td>\n",
       "      <td>sx</td>\n",
       "      <td>328</td>\n",
       "      <td>统计班</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>202cb962ac59075b964b07152d234b70</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>2016/8/9 11:27:27</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>328</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>18688880001</td>\n",
       "      <td>叶亦凯</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>982</td>\n",
       "      <td>NaN</td>\n",
       "      <td>叶亦凯</td>\n",
       "      <td>sx</td>\n",
       "      <td>328</td>\n",
       "      <td>统计班</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>202cb962ac59075b964b07152d234b70</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>2016/8/20 12:09:36</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>328</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>18688880001</td>\n",
       "      <td>叶亦凯</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>982</td>\n",
       "      <td>NaN</td>\n",
       "      <td>叶亦凯</td>\n",
       "      <td>sx</td>\n",
       "      <td>328</td>\n",
       "      <td>统计班</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>202cb962ac59075b964b07152d234b70</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>2016/8/26 14:09:50</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>328</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>18688880001</td>\n",
       "      <td>叶亦凯</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>983</td>\n",
       "      <td>NaN</td>\n",
       "      <td>邓彬彬</td>\n",
       "      <td>lyy</td>\n",
       "      <td>328</td>\n",
       "      <td>统计班</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>202cb962ac59075b964b07152d234b70</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>328</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>18688880002</td>\n",
       "      <td>邓彬彬</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>984</td>\n",
       "      <td>NaN</td>\n",
       "      <td>张建涛</td>\n",
       "      <td>zad</td>\n",
       "      <td>328</td>\n",
       "      <td>统计班</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>202cb962ac59075b964b07152d234b70</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>2016/8/16 13:12:54</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>328</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>18688880003</td>\n",
       "      <td>张建涛</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>940</td>\n",
       "      <td>1606</td>\n",
       "      <td>NaN</td>\n",
       "      <td>柴亮亮</td>\n",
       "      <td>a735</td>\n",
       "      <td>330</td>\n",
       "      <td>统计17级</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>202cb962ac59075b964b07152d234b476</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>2016/8/6 19:09:32</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>330</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>18688880805</td>\n",
       "      <td>柴亮亮</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>941</td>\n",
       "      <td>1607</td>\n",
       "      <td>NaN</td>\n",
       "      <td>柴成立</td>\n",
       "      <td>a736</td>\n",
       "      <td>330</td>\n",
       "      <td>统计17级</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>202cb962ac59075b964b07152d234b477</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>2016/8/7 20:24:45</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>330</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>18688880806</td>\n",
       "      <td>柴成立</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>942</td>\n",
       "      <td>1608</td>\n",
       "      <td>NaN</td>\n",
       "      <td>柴书琴</td>\n",
       "      <td>a737</td>\n",
       "      <td>330</td>\n",
       "      <td>统计17级</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>202cb962ac59075b964b07152d234b478</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>330</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>18688880807</td>\n",
       "      <td>柴书琴</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>943</td>\n",
       "      <td>1609</td>\n",
       "      <td>NaN</td>\n",
       "      <td>柴豪逊</td>\n",
       "      <td>a738</td>\n",
       "      <td>330</td>\n",
       "      <td>统计17级</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>202cb962ac59075b964b07152d234b479</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>2016/8/6 17:28:26</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>330</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>18688880808</td>\n",
       "      <td>柴豪逊</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>944</td>\n",
       "      <td>1610</td>\n",
       "      <td>NaN</td>\n",
       "      <td>柴观骁</td>\n",
       "      <td>a739</td>\n",
       "      <td>330</td>\n",
       "      <td>统计17级</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>202cb962ac59075b964b07152d234b480</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>2016/8/7 12:41:07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>328</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>18688880809</td>\n",
       "      <td>柴观骁</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>945 rows × 58 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     USER_ID MYID ACCOUNT  NAME  ORGANIZE_ID ORGANIZE_NAME  DUTY_ID  TITLE_ID  \\\n",
       "0        982  NaN     叶亦凯    sx          328           统计班      NaN       NaN   \n",
       "1        982  NaN     叶亦凯    sx          328           统计班      NaN       NaN   \n",
       "2        982  NaN     叶亦凯    sx          328           统计班      NaN       NaN   \n",
       "3        983  NaN     邓彬彬   lyy          328           统计班      NaN       NaN   \n",
       "4        984  NaN     张建涛   zad          328           统计班      NaN       NaN   \n",
       "..       ...  ...     ...   ...          ...           ...      ...       ...   \n",
       "940     1606  NaN     柴亮亮  a735          330         统计17级      NaN       NaN   \n",
       "941     1607  NaN     柴成立  a736          330         统计17级      NaN       NaN   \n",
       "942     1608  NaN     柴书琴  a737          330         统计17级      NaN       NaN   \n",
       "943     1609  NaN     柴豪逊  a738          330         统计17级      NaN       NaN   \n",
       "944     1610  NaN     柴观骁  a739          330         统计17级      NaN       NaN   \n",
       "\n",
       "                              PASSWORD EMAIL  ...           lock_time  \\\n",
       "0     202cb962ac59075b964b07152d234b70   NaN  ...   2016/8/9 11:27:27   \n",
       "1     202cb962ac59075b964b07152d234b70   NaN  ...  2016/8/20 12:09:36   \n",
       "2     202cb962ac59075b964b07152d234b70   NaN  ...  2016/8/26 14:09:50   \n",
       "3     202cb962ac59075b964b07152d234b70   NaN  ...                 NaN   \n",
       "4     202cb962ac59075b964b07152d234b70   NaN  ...  2016/8/16 13:12:54   \n",
       "..                                 ...   ...  ...                 ...   \n",
       "940  202cb962ac59075b964b07152d234b476   NaN  ...   2016/8/6 19:09:32   \n",
       "941  202cb962ac59075b964b07152d234b477   NaN  ...   2016/8/7 20:24:45   \n",
       "942  202cb962ac59075b964b07152d234b478   NaN  ...                 NaN   \n",
       "943  202cb962ac59075b964b07152d234b479   NaN  ...   2016/8/6 17:28:26   \n",
       "944  202cb962ac59075b964b07152d234b480   NaN  ...   2016/8/7 12:41:07   \n",
       "\n",
       "     cashier_id pc_id  order_number org_id  print_doc_bill_num  \\\n",
       "0           NaN   NaN           NaN    328                 NaN   \n",
       "1           NaN   NaN           NaN    328                 NaN   \n",
       "2           NaN   NaN           NaN    328                 NaN   \n",
       "3           NaN   NaN           NaN    328                 NaN   \n",
       "4           NaN   NaN           NaN    328                 NaN   \n",
       "..          ...   ...           ...    ...                 ...   \n",
       "940         NaN   NaN           NaN    330                 NaN   \n",
       "941         NaN   NaN           NaN    330                 NaN   \n",
       "942         NaN   NaN           NaN    330                 NaN   \n",
       "943         NaN   NaN           NaN    330                 NaN   \n",
       "944         NaN   NaN           NaN    328                 NaN   \n",
       "\n",
       "     lock_table_info  order_status        phone name  \n",
       "0                NaN             1  18688880001  叶亦凯  \n",
       "1                NaN             1  18688880001  叶亦凯  \n",
       "2                NaN             1  18688880001  叶亦凯  \n",
       "3                NaN             0  18688880002  邓彬彬  \n",
       "4                NaN             1  18688880003  张建涛  \n",
       "..               ...           ...          ...  ...  \n",
       "940              NaN             1  18688880805  柴亮亮  \n",
       "941              NaN             1  18688880806  柴成立  \n",
       "942              NaN             0  18688880807  柴书琴  \n",
       "943              NaN             1  18688880808  柴豪逊  \n",
       "944              NaN             1  18688880809  柴观骁  \n",
       "\n",
       "[945 rows x 58 columns]"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [],
   "source": [
    "csyye = pd.read_excel(r'D:\\Desktop\\超市营业额2.xlsx')\n",
    "csyye2 = deepcopy(csyye)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>工号</th>\n",
       "      <th>交易额</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>姓名</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>周七</td>\n",
       "      <td>42210</td>\n",
       "      <td>50208.90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>张三</td>\n",
       "      <td>38038</td>\n",
       "      <td>58130.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>李四</td>\n",
       "      <td>47094</td>\n",
       "      <td>58730.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>王五</td>\n",
       "      <td>40120</td>\n",
       "      <td>58892.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>赵六</td>\n",
       "      <td>45180</td>\n",
       "      <td>56069.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>钱八</td>\n",
       "      <td>37222</td>\n",
       "      <td>48813.45</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       工号       交易额\n",
       "姓名                 \n",
       "周七  42210  50208.90\n",
       "张三  38038  58130.00\n",
       "李四  47094  58730.00\n",
       "王五  40120  58892.00\n",
       "赵六  45180  56069.00\n",
       "钱八  37222  48813.45"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "A = csyye2.groupby(by='姓名')\n",
    "A.sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [],
   "source": [
    "yg1 = A.get_group(\"周七\")['交易额'].mean()\n",
    "for jye in A.get_group(\"周七\")['交易额'].isnull():\n",
    "    csyye2['交易额'].fillna(yg1, inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [],
   "source": [
    "yg1 = A.get_group(\"张三\")['交易额'].mean()\n",
    "for jye in A.get_group(\"张三\")['交易额'].isnull():\n",
    "    csyye2['交易额'].fillna(yg1, inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [],
   "source": [
    "yg1 = A.get_group(\"李四\")['交易额'].mean()\n",
    "for jye in A.get_group(\"李四\")['交易额'].isnull():\n",
    "    csyye2['交易额'].fillna(yg1, inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [],
   "source": [
    "yg1 = A.get_group(\"王五\")['交易额'].mean()\n",
    "for jye in A.get_group(\"王五\")['交易额'].isnull():\n",
    "    csyye2['交易额'].fillna(yg1, inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [],
   "source": [
    "yg1 = A.get_group(\"赵六\")['交易额'].mean()\n",
    "for jye in A.get_group(\"赵六\")['交易额'].isnull():\n",
    "    csyye2['交易额'].fillna(yg1, inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [],
   "source": [
    "yg1 = A.get_group(\"钱八\")['交易额'].mean()\n",
    "for jye in A.get_group(\"钱八\")['交易额'].isnull():\n",
    "    csyye2['交易额'].fillna(yg1, inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>工号</th>\n",
       "      <th>姓名</th>\n",
       "      <th>日期</th>\n",
       "      <th>时段</th>\n",
       "      <th>交易额</th>\n",
       "      <th>柜台</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>1001</td>\n",
       "      <td>张三</td>\n",
       "      <td>2019-03-01</td>\n",
       "      <td>9：00-14：00</td>\n",
       "      <td>1664.0</td>\n",
       "      <td>化妆品</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>1002</td>\n",
       "      <td>李四</td>\n",
       "      <td>2019-03-01</td>\n",
       "      <td>14：00-21：00</td>\n",
       "      <td>954.0</td>\n",
       "      <td>化妆品</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>1003</td>\n",
       "      <td>王五</td>\n",
       "      <td>2019-03-01</td>\n",
       "      <td>9：00-14：00</td>\n",
       "      <td>1407.0</td>\n",
       "      <td>食品</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>1004</td>\n",
       "      <td>赵六</td>\n",
       "      <td>2019-03-01</td>\n",
       "      <td>14：00-21：00</td>\n",
       "      <td>1320.0</td>\n",
       "      <td>食品</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>1005</td>\n",
       "      <td>周七</td>\n",
       "      <td>2019-03-01</td>\n",
       "      <td>9：00-14：00</td>\n",
       "      <td>994.0</td>\n",
       "      <td>日用品</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>244</td>\n",
       "      <td>1002</td>\n",
       "      <td>李四</td>\n",
       "      <td>2019-03-31</td>\n",
       "      <td>14：00-21：00</td>\n",
       "      <td>859.0</td>\n",
       "      <td>蔬菜水果</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>245</td>\n",
       "      <td>1004</td>\n",
       "      <td>赵六</td>\n",
       "      <td>2019-03-31</td>\n",
       "      <td>9：00-14：00</td>\n",
       "      <td>1668.0</td>\n",
       "      <td>日用品</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>246</td>\n",
       "      <td>1004</td>\n",
       "      <td>赵六</td>\n",
       "      <td>2019-03-31</td>\n",
       "      <td>14：00-21：00</td>\n",
       "      <td>1722.0</td>\n",
       "      <td>日用品</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>247</td>\n",
       "      <td>1003</td>\n",
       "      <td>王五</td>\n",
       "      <td>2019-03-31</td>\n",
       "      <td>9：00-14：00</td>\n",
       "      <td>1274.0</td>\n",
       "      <td>食品</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>248</td>\n",
       "      <td>1006</td>\n",
       "      <td>钱八</td>\n",
       "      <td>2019-03-31</td>\n",
       "      <td>14：00-21：00</td>\n",
       "      <td>812.0</td>\n",
       "      <td>食品</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>249 rows × 6 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       工号  姓名          日期           时段     交易额    柜台\n",
       "0    1001  张三  2019-03-01   9：00-14：00  1664.0   化妆品\n",
       "1    1002  李四  2019-03-01  14：00-21：00   954.0   化妆品\n",
       "2    1003  王五  2019-03-01   9：00-14：00  1407.0    食品\n",
       "3    1004  赵六  2019-03-01  14：00-21：00  1320.0    食品\n",
       "4    1005  周七  2019-03-01   9：00-14：00   994.0   日用品\n",
       "..    ...  ..         ...          ...     ...   ...\n",
       "244  1002  李四  2019-03-31  14：00-21：00   859.0  蔬菜水果\n",
       "245  1004  赵六  2019-03-31   9：00-14：00  1668.0   日用品\n",
       "246  1004  赵六  2019-03-31  14：00-21：00  1722.0   日用品\n",
       "247  1003  王五  2019-03-31   9：00-14：00  1274.0    食品\n",
       "248  1006  钱八  2019-03-31  14：00-21：00   812.0    食品\n",
       "\n",
       "[249 rows x 6 columns]"
      ]
     },
     "execution_count": 86,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "csyye2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('周七', 4       994.0\n",
       "  12     1444.0\n",
       "  20     1592.0\n",
       "  23     1638.0\n",
       "  28     1346.0\n",
       "  31     1199.0\n",
       "  36     1249.0\n",
       "  44     1699.0\n",
       "  47     1778.0\n",
       "  52     1465.0\n",
       "  60     1029.0\n",
       "  68     1012.0\n",
       "  76       53.0\n",
       "  77      980.0\n",
       "  84      859.0\n",
       "  85     1633.0\n",
       "  92     1302.0\n",
       "  93     1317.0\n",
       "  101     922.0\n",
       "  102    1047.0\n",
       "  110       NaN\n",
       "  111    1387.0\n",
       "  118     916.0\n",
       "  119    1048.0\n",
       "  126    1246.0\n",
       "  127     887.0\n",
       "  135    1022.0\n",
       "  143    1329.0\n",
       "  151    1058.0\n",
       "  159    1046.0\n",
       "  167    1581.0\n",
       "  168       NaN\n",
       "  176    1437.0\n",
       "  184    1523.0\n",
       "  195     865.0\n",
       "  203    1006.0\n",
       "  211     866.0\n",
       "  219     871.0\n",
       "  227    1737.0\n",
       "  235    1070.0\n",
       "  241    1321.0\n",
       "  243    1044.0\n",
       "  Name: 交易额, dtype: float64), ('张三', 0       1664.0\n",
       "  7       1442.0\n",
       "  8       1530.0\n",
       "  16      1361.0\n",
       "  24      1216.0\n",
       "  32      1391.0\n",
       "  39       856.0\n",
       "  40      1037.0\n",
       "  54      1263.0\n",
       "  72      1456.0\n",
       "  73      1040.0\n",
       "  90      1651.0\n",
       "  91      1435.0\n",
       "  96      1284.0\n",
       "  99      1333.0\n",
       "  105    12100.0\n",
       "  112     1261.0\n",
       "  120     1035.0\n",
       "  128     1408.0\n",
       "  136     1791.0\n",
       "  144     1378.0\n",
       "  149     1376.0\n",
       "  152      844.0\n",
       "  157     1037.0\n",
       "  160      829.0\n",
       "  169      946.0\n",
       "  177     1296.0\n",
       "  178     1271.0\n",
       "  186     1135.0\n",
       "  194      114.0\n",
       "  202      853.0\n",
       "  205     1746.0\n",
       "  209     1649.0\n",
       "  217     1612.0\n",
       "  218     1031.0\n",
       "  225     1523.0\n",
       "  233      850.0\n",
       "  237     1086.0\n",
       "  Name: 交易额, dtype: float64), ('李四', 1       954.0\n",
       "  9      1395.0\n",
       "  14     1649.0\n",
       "  17     1034.0\n",
       "  25     1629.0\n",
       "  30     1105.0\n",
       "  33     1456.0\n",
       "  38     1692.0\n",
       "  41      822.0\n",
       "  49     1199.0\n",
       "  55      831.0\n",
       "  57      867.0\n",
       "  62     1472.0\n",
       "  65     1382.0\n",
       "  78     1478.0\n",
       "  81     1045.0\n",
       "  89      979.0\n",
       "  97       98.0\n",
       "  106     822.0\n",
       "  113    1798.0\n",
       "  114    1156.0\n",
       "  121    1788.0\n",
       "  122    1590.0\n",
       "  129     828.0\n",
       "  137     824.0\n",
       "  145    1459.0\n",
       "  153    1332.0\n",
       "  156    1615.0\n",
       "  161    1528.0\n",
       "  164     888.0\n",
       "  172     864.0\n",
       "  180    1573.0\n",
       "  183    1276.0\n",
       "  188    1793.0\n",
       "  191    1285.0\n",
       "  196    1647.0\n",
       "  199    1349.0\n",
       "  204    1390.0\n",
       "  207     986.0\n",
       "  212    1145.0\n",
       "  220    1070.0\n",
       "  226    1624.0\n",
       "  228    1063.0\n",
       "  234    1688.0\n",
       "  236    1129.0\n",
       "  242    1274.0\n",
       "  244     859.0\n",
       "  Name: 交易额, dtype: float64), ('王五', 2      1407.0\n",
       "  10      936.0\n",
       "  15     1179.0\n",
       "  18     1713.0\n",
       "  26     1590.0\n",
       "  34     1687.0\n",
       "  42     1200.0\n",
       "  48     1713.0\n",
       "  56     1184.0\n",
       "  63     1104.0\n",
       "  64     1106.0\n",
       "  71     1670.0\n",
       "  79     1135.0\n",
       "  86      801.0\n",
       "  94      831.0\n",
       "  98     1053.0\n",
       "  107    1642.0\n",
       "  115    1483.0\n",
       "  123    1498.0\n",
       "  130     912.0\n",
       "  131    1697.0\n",
       "  138    1049.0\n",
       "  139    1210.0\n",
       "  146    1026.0\n",
       "  147     846.0\n",
       "  154    1485.0\n",
       "  162    1182.0\n",
       "  170    1367.0\n",
       "  173    1498.0\n",
       "  181    1695.0\n",
       "  189    1314.0\n",
       "  197     958.0\n",
       "  198    1527.0\n",
       "  206    1244.0\n",
       "  214     999.0\n",
       "  222    1210.0\n",
       "  223    9031.0\n",
       "  231    1404.0\n",
       "  239    1032.0\n",
       "  247    1274.0\n",
       "  Name: 交易额, dtype: float64), ('赵六', 3      1320.0\n",
       "  11      906.0\n",
       "  19     1236.0\n",
       "  22     1073.0\n",
       "  27     1673.0\n",
       "  35      974.0\n",
       "  43     1245.0\n",
       "  50     1340.0\n",
       "  51      942.0\n",
       "  58     1073.0\n",
       "  59      825.0\n",
       "  66     1683.0\n",
       "  67     1040.0\n",
       "  74     1061.0\n",
       "  75     1586.0\n",
       "  80     1032.0\n",
       "  87     1454.0\n",
       "  88     1183.0\n",
       "  100    1130.0\n",
       "  108    1033.0\n",
       "  109    1026.0\n",
       "  117    1449.0\n",
       "  125    1008.0\n",
       "  133    1336.0\n",
       "  134     879.0\n",
       "  141     952.0\n",
       "  142    1379.0\n",
       "  150     882.0\n",
       "  158    1649.0\n",
       "  165    1008.0\n",
       "  166    1667.0\n",
       "  174     981.0\n",
       "  182    1603.0\n",
       "  185    1775.0\n",
       "  190    1152.0\n",
       "  193     860.0\n",
       "  201    1599.0\n",
       "  210    1257.0\n",
       "  213    1301.0\n",
       "  221    1224.0\n",
       "  229     910.0\n",
       "  230    1402.0\n",
       "  238    1571.0\n",
       "  245    1668.0\n",
       "  246    1722.0\n",
       "  Name: 交易额, dtype: float64), ('钱八', 5      1421.0\n",
       "  6      1226.0\n",
       "  13     1141.0\n",
       "  21     1457.0\n",
       "  29     1402.0\n",
       "  37     1578.0\n",
       "  45     1199.0\n",
       "  46     1162.0\n",
       "  53      950.0\n",
       "  61     1688.0\n",
       "  69     1087.0\n",
       "  70     1118.0\n",
       "  82     1737.0\n",
       "  83     1549.0\n",
       "  95     1530.0\n",
       "  103    1609.0\n",
       "  104    1609.0\n",
       "  116    1085.0\n",
       "  124       NaN\n",
       "  132     840.0\n",
       "  140    1567.0\n",
       "  148    1483.0\n",
       "  155     980.0\n",
       "  163     807.0\n",
       "  171    1555.0\n",
       "  175    1503.0\n",
       "  179    1496.0\n",
       "  187    1579.0\n",
       "  192     966.0\n",
       "  200    1178.0\n",
       "  208    1360.0\n",
       "  215    1301.0\n",
       "  216    1695.0\n",
       "  224    1219.0\n",
       "  232    1639.0\n",
       "  240    1090.0\n",
       "  248     812.0\n",
       "  Name: 交易额, dtype: float64)]"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "A = csyye['姓名']['交易额']\n",
    "[i for i in A]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'count' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-1-705f83893deb>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mcount\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'a'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m: name 'count' is not defined"
     ]
    }
   ],
   "source": [
    "count('a')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
